<template>
  <div class="app-container">
    <el-form :inline="true">
      <el-form-item label="活动名称">
        <el-input v-model="listQuery.txtContacts" />
      </el-form-item>

      <el-form-item label="药店用户手机号">
        <el-input v-model="listQuery.txtMobile" />
      </el-form-item>

      <el-form-item label="状态">
        <el-select v-model="listQuery.isDispose" placeholder="请选择状态">
          <el-option label="--" value="0" />
          <el-option label="待处理" value="0" />
          <el-option label="已处理" value="1" />
        </el-select>
      </el-form-item>
       <el-button type="primary">搜索</el-button>

      <el-table :data="list" border style="width: 100%">
        <el-table-column prop="userName" label="药店名称" align="center">
          <template slot-scope="scope">
            <span>{{scope.row.userName}}</span>
          </template>
        </el-table-column>

        <el-table-column prop="mobile" label="药店用户手机号" align="center">
          <template slot-scope="scope">
            <span>{{scope.row.mobile}}</span>
          </template>
        </el-table-column>

        <el-table-column prop="content" label="投诉内容" align="center">
          <template slot-scope="scope">
            <span>{{scope.row.content}}</span>
          </template>
        </el-table-column>

        <el-table-column prop="fileCount" label="附件" align="center">
          <template slot-scope="scope">
            <span>{{scope.row.fileCount}}</span>
          </template>
        </el-table-column>

        <el-table-column prop="addTimeStr" label="时间" align="center">
          <template slot-scope="scope">
            <span>{{scope.row.addTimeStr}}</span>
          </template>
        </el-table-column>

        <el-table-column prop label="处理结果" align="center"></el-table-column>

        <el-table-column prop label="操作" align="center">
          <template slot-scope="scope">
          <el-dropdown-item @click.native="handle(scope.row)">标记为已处理</el-dropdown-item>
          </template>
        </el-table-column>
      </el-table>
    </el-form>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="listQuery.currentPage"
      :limit.sync="listQuery.showCount"
      @pagination="getList"
    />
    
    <handle ref="handle" />
     
  </div>
</template>

<script>
import apicomplaint from "@/api/frontManage/complaint";
import Pagination from "@/components/Pagination";
import handle from './dialogHandleResule'
export default {
  name: "complaint",
  components: { Pagination ,handle},
  data() {
    return {
      list: [],
      total: 0,
      listQuery: {
        currentPage: 1,
        showCount: 10,
        txtContacts: "",
        txtMobile: "",
        isDispose: ""
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    getList() {
      let data = apicomplaint.getComplainList();
      this.list = data.list;
      this.total = data.page.totalResult;
    },
    //处理结果
    handle(row){
      this.$refs.handle.open(row)
    }
  }
};
</script>

<style scoped>
</style>